home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / AppleShare API / ServerEvent / ServerEventIntf.a next >
Encoding:
Text File  |  1992-05-19  |  7.4 KB  |  119 lines  |  [TEXT/MPS ]

  1.  
  2. ; Created: Friday, May 8, 1992 3:53 PM
  3. ;
  4. ; File: ServerEventIntf.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1990
  8. ; All Rights Reserved
  9. ;
  10. ;___________________________________________________________________________
  11. ; NOTE: use this interface file with new kind of AINCLUDES available on ETO
  12.  
  13.  IF (&TYPE('__ServerEventIntf__') = 'UNDEFINED') THEN
  14. __ServerEventIntf__   SET 1
  15.  
  16.  IF &TYPE('__AppleTalk__') = 'UNDEFINED' THEN
  17.  INCLUDE 'AppleTalk.a'
  18.  ENDIF
  19.  
  20.  
  21. ; Constants used in the tSEQEntry 
  22.  
  23. ; The SEeventFlag bits in tSEQEntry specify when the server event handler would like to be called 
  24. ; SEeventFlag bits 
  25. bCSEHAFPInDoRequest    EQU     0        ; An AFP call is starting up (in DoRequest, about to be dispatched) 
  26. bCSEHAFPInSendResponse EQU     1        ; An AFP call has completed (in SendResponse, about to send out the response) 
  27. bCSEHServerBusy        EQU     2        ; A new session is being denied because the server is busy (socket starvation event) 
  28. bCSEHServerShutdown    EQU     3        ; The server just shut down 
  29. bCSEHServerControlCall EQU     4        ; A server control call has just completed 
  30.                                                      ; NOTE: The following server control calls do not cause a bCSEHServerControlCall server event:
  31.                                                      ; SCStartServer, SCInstallServerEventProc, SCRemoveServerEventProc, SCGetServerEventProc, SCServerVersion, and SCWakeServer.
  32.                                                      ; You can use the bCSEHServerStartup server event to detect server starts and wakeups.
  33. bCSEHShare             EQU     5        ; An HFS Share trap has just completed 
  34. bCSEHUnShare           EQU     6        ; An HFS UnShare trap has just completed 
  35. bCSEHSetDirAccess      EQU     7        ; An HFS SetDirAccess trap has just completed 
  36. bCSEHServerNameChange  EQU     8        ; An attempt was made to change the server name (the attempt may or may not have been successful) 
  37. bCSEHVolumePrep        EQU     9        ; A new volume was just prepared for use with AppleShare 
  38. bCSEHVolumeUnmount     EQU     10       ; A volume unmount was attempted on an AppleShare volume 
  39. bCSEHServerStartup     EQU     11       ; The server just successfully started up 
  40. bCSEHSessionTornDown   EQU     12       ; A user's session was torn down because any one of a number of reasons, including a 
  41.                                                      ; disconnect, server shutdown, timeout, or workstation initiated close session
  42. bCSEHOutOfSequence     EQU     13       ; A packet was received out of sequence; the session may be a zombie 
  43. bCSEHWksClosedSession  EQU     14       ; A workstation closed its ASP session (i.e., it logged out) 
  44. bCSEHSessionTimedOut   EQU     15       ; A workstation's session timed out 
  45. bCSEHSrvrClosedSession EQU     16       ; The server has closed a workstation's session 
  46.  
  47.  
  48. ; When SEeventFlag bits bCSEHAFPInDoRequest or bCSEHAFPInSendResponse are set, the bits in SEwhichAFPFlag 
  49. ; determine which AFP calls will cause the server event handler to be called. 
  50. ; SEwhichAFPFlag bits 
  51. ; bit 0  of SEwhichAFPFlag[1] - call SE handler when AFPCommand = 192 (afpAddIcon) 
  52. ; bit 1  of SEwhichAFPFlag[1] - call SE handler when AFPCommand = 1 
  53. ; bit 2  of SEwhichAFPFlag[1] - call SE handler when AFPCommand = 2 
  54. ; ...                 
  55. ; bit 31 of SEwhichAFPFlag[1] - call SE handler when AFPCommand = 31 
  56. ; bit 0  of SEwhichAFPFlag[0] - call SE handler when AFPCommand = 32 
  57. ; ...                 
  58. ; bit 63 of SEwhichAFPFlag[0] - call SE handler when AFPCommand = 63 
  59.  
  60.  
  61. ; When SEeventFlag bit bCSEHServerControlCall is set, the bits in SEwhichSCFlag determine 
  62. ; which server control calls will cause the server event handler to be called. 
  63. ; SEwhichSCFlag bits 
  64. ; bit 0  of SEwhichSCFlag - call SE handler when scCode = 0 (SCStartServer) 
  65. ; ...               
  66. ; bit 31 of SEwhichSCFlag - call SE handler when scCode = 31 
  67.  
  68.  
  69. BufferMax              EQU     48       ; maximum size of the Buffer in the ServerEventRecord 
  70.  
  71. ServerEventRecord      RECORD  0
  72. theEventNumber         DS.L    1        ; long:  the server event that's occuring; see the SEeventFlag definitions above 
  73. theServerTime          DS.L    1        ; long:  the server time (in Macintosh DateTime form) 
  74. theResult              DS.W    1        ; OSErr:  the result of the operation 
  75.                                                      ; if theEventNumber = bCSEHAFPInSendResponse: the AFP Error code to be returned 
  76.                                                      ; if theEventNumber = bCSEHServerControlCall: the result of the server control call 
  77.                                                      ; if theEventNumber = bCSEHShare, bCSEHUnShare, or bCSEHSetDirAccess: the result of the HFS call 
  78.                                                      ; if theEventNumber = bCSEHServerNameChange: the result of a PRegisterName call, SECantRegNameErr, or SEDupNameErr 
  79.                                                      ; if theEventNumber = bCSEHVolumeUnmount: noErr or fBsyErr (if volume is being used by a remote user) 
  80.                                                      ; all other values of theEventNumber return noErr
  81. theBufSize                  DS.W     1             ; the number of bytes used in theBuffer 
  82. theBuffer                  DS.B     BufferMax ; Array of Byte:
  83.                                                      ; if theEventNumber = bCSEHAFPInDoRequest or bCSEHAFPInSendResponse: the first BufferMax bytes of the AFP packet */
  84.                                                      ; if theEventNumber = bCSEHServerControlCall: the first BufferMax bytes of the SCParamBlockRec */
  85.                                                      ; if theEventNumber = bCSEHShare, bCSEHUnShare, bCSEHSetDirAccess, bCSEHVolumePrep, or bCSEHVolumeUnmount: */
  86.                                                      ;                     the first BufferMax bytes of the HParamBlockRec */
  87.                                                      ; if theEventNumber = bCSEHServerNameChange: the new server name (in a Pascal string) */
  88.                                                      ; all other values of theEventNumber return a zero length buffer */
  89. theNameStr                  DS.B     32         ; Str31:  the name of the file, if any; not always defined 
  90. theAFPCommand              DS.W     1             ; short:   if theEventNumber = bCSEHAFPInDoRequest or bCSEHAFPInSendResponse, the AFP call number 
  91.  
  92. ; Note: If theEventNumber is bCSEHAFPInDoRequest, bCSEHAFPInSendResponse, bCSEHSessionTornDown, bCSEHOutOfSequence, 
  93. ; bCSEHWksClosedSession, bCSEHSessionTimedOut, or bCSEHSrvrClosedSession, then theUNRecID, theUNSUserID, 
  94. ; theUserName, and theSocketAddress of the user that made the call are returned. 
  95.         
  96. theUNRecID                  DS.L     1             ; long:  the UNRecID of the user that made the call
  97. theUNSUserID              DS.L     1             ; long:  the UserID of the user that made the call
  98. theUserName                  DS.B     32         ; Str31:  the name of the user that made the call
  99.  
  100. ; Note: If theEventNumber is bCSEHAFPInDoRequest or bCSEHAFPInSendResponse, then theVRefNum and theDirID will be 
  101. ; returned if applicable to the AFP call 
  102.  
  103. theVRefNum                  DS.W     1             ; short:  the VRefNum of the volume upon which this operation was performed (not always applicable) 
  104. theDirID                      DS.L     1             ; long:  the DirID of the directory upon/within which this operation was performed (not always applicable) 
  105. theSocketAddress          DS         AddrBlockRec ; the network address of the user's workstation in AddrBlock format 
  106. size                   EQU     *
  107.                        ENDR
  108.  
  109.  
  110. tSEQEntry              RECORD  0
  111. SEQentry               DS      ATQEntry ; a regular AppleTalk Transition Queue entry 
  112. SEeventFlag            DS.L    1        ; long:  specifies when the Server Event Handler would like to be called 
  113. SEwhichAFPFlag         DS.L    2        ; Array of long:  specifies which AFP calls will cause the Server Event Handler to be called 
  114. SEwhichSCFlag          DS.L    1        ; long:  specifies which Server Control calls will cause the Server Event Handler to be called 
  115. size                   EQU     *
  116.                        ENDR
  117.  
  118.  
  119.                        ENDIF    ;  ...already included